package edu.sctu.renpingan.ioflow.IofolwFilereader;

import edu.sctu.jarime.may.day20150525.Change.C;

import java.io.*;

/**
 * Created by Administrator on 2015/6/14.
 */
public class IoFolwFileReader {
    FileReader fileReader;
    FileWriter fileWriter;   int number = 0;
    int anInt = 0;
    char[] chars = new char[1024];
    public void getFileReader(){
        try {
            fileReader = new FileReader(new File("E://China1.txt"));
            try {
                fileWriter = new FileWriter(new File("E://China2.txt"));
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                while ((number = fileReader.read(chars)) != -1)
                {

                    System.out.println((char)number);
                    fileWriter.write(chars,0,number);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                fileReader.close();
                fileWriter.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }
}
